<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3" xmlns:head="http://www.w3.org/1999/html">
<head th:include="public/public_css::public_css ('LPN管理')" />

<body style="background-color: #f2f2f2;">
<div class="layui-fluid larry-wrapper">
    <div class="layui-card">
        <div class="layui-row layui-col-space30">
            <div class="layui-col-xs24">
                <form class="layui-form layui-card-header  layui-card-header-auto" id="searchForm">

                    <div class="layui-inline" style="width: 190px">
                        <label class="layui-form-label">LPN码</label>
                        <div class="layui-inline">
                            <input type="text" name="lpn_code" placeholder="请输入LPN码"  class="layui-input" style="width: 190px">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">生成开始时间</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="scsj_start" id="test5" placeholder="yyyy-MM-dd" />
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">  </label>
                    <div class="layui-input-inline" style="height:20px">
                        --
                    </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">生成结束时间</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="scsj_end" id="test6" placeholder="yyyy-MM-dd" />

                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">状态</label>
                        <select name="isBinding" lay-filter="aihao">
                        <option value="">全部</option>
                        <option value="0">未使用</option>
                        <option value="1">已使用</option>
                         </select>
                    </div>
                    <div class="layui-inline inline-search-btn">
                        <a class="layui-btn layui-btn-normal" data-type="reload" id="search_button"> 搜索 </a>
                    </div>
                    <div class="layui-inline inline-reset-btn">
                        <button type="reset" class="layui-btn layui-btn-primary" style="background-color: #40AFFE">重置</button>
                    </div>
                </form>
                    <div class="group-button" id="toolbar">

                    <a class="layui-btn layui-btn-sm layui-btn-normal add-btn">
                        <i class="layui-icon">&#x1005;</i> 生成
                    </a>

                </div>
                <!--列表-->
                <section class="panel panel-padding layui-card-body" >
                    <div class="pro">
                        <table id="table"></table>
                    </div>
                </section>
            </div>
        </div>
    </div>
</div>
</body>

<div th:include="public/public_js::public_js"></div>
<script>
    //	回车查询
    document.onkeydown = function(event) {
        e = event ? event : (window.event ? window.event : null);
        if (e.keyCode == 13) {
            //执行的方法
            $('#search_button').click();
        }
    };

    layui.use(['list','layer','zzpUtils','jquery','laydate'],function () {
        var zzpUtils= layui.zzpUtils,
            $ = layui.jquery,
            laydate = layui.laydate;
        window.operateEvent ={
            "click .layui-btn-primary":function (e, value, row, index) {
                alert(row.mc);
            }
        }
        //创建时间开始
        laydate.render({
            elem: '#test5'
            ,theme: '#20a0ff',
        })
        //创建时间结束
        laydate.render({
            elem: '#test6'
            ,theme: '#20a0ff',
        })
        //查询list
        var $table = zzpUtils.table({
            elem: '#table',
            isApi: true,
            pagination:true,
            url: '/wmsLpn/list',
            columns: [{
                field: '',
                checkbox: true
            }, {
                field: 'lpn_code',
                title: 'LPN码'
            },{
                field: 'show_isBinding',
                title: '状态'
            },{
                field: 'scsj',
                title: '生成时间'
            }],

            queryParams: function () {//查询条件
                return  zzpUtils.getFormJson($("#searchForm"));
            },
            detailFormatter: function (index, row) {
                return "这里就没有确定过11";
            }
        });

        $(".inline-search-btn").on('click',function () {
            zzpUtils.refreshTable("#table");
        })
        //跳转生成添加页面
        $(".add-btn").on('click',function () {
            zzpUtils.dialog({
                title:"生成LPN",
                type:2,
                content: "/lpnRouter/toAddLpn",
                area: ['50%', '50%'],
                btn:[],
                end: function () {//添加成功后刷新
                    zzpUtils.refreshTable("#table");
                }
            });
        })
    });
</script>
</html>